package com.zhentao.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.common.pojo.activity.Activity;
import com.zhentao.service.ActivityService;
import com.zhentao.mapper.ActivityMapper;
import com.zhentao.service.FileStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
* @author 田桑
* @description 针对表【activity(活动模板表)】的数据库操作Service实现
* @createDate 2024-12-28 09:38:51
*/
@Service
public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity>
    implements ActivityService{
    @Autowired
    private FileStorageService fileStorageService;

    @Override
    public ResponseResult upload(MultipartFile file) throws IOException {
        String s = fileStorageService.uploadImage(file.getOriginalFilename(),file.getInputStream());
        return ResponseResult.okResult(s);
    }
}




